from django.contrib import admin
from .models import Personnel, Equipment


@admin.register(Personnel)
class PersonnelAdmin(admin.ModelAdmin):
    """
    人员信息管理界面
    """
    list_display = ['id', 'name', 'phone', 'group', 'created_at', 'updated_at']
    list_filter = ['group', 'created_at']
    search_fields = ['name', 'phone', 'group']
    ordering = ['id']
    readonly_fields = ['created_at', 'updated_at']


@admin.register(Equipment)
class EquipmentAdmin(admin.ModelAdmin):
    """
    设备信息管理界面
    """
    list_display = ['id', 'name', 'experiment', 'responsible', 'created_at', 'updated_at']
    list_filter = ['responsible', 'created_at']
    search_fields = ['name', 'experiment', 'responsible']
    ordering = ['id']
    readonly_fields = ['created_at', 'updated_at']
